local skel= fk.CreateSkill({
    name = "history__dianhua",
  })
  
  Fk:loadTranslationTable{
    ["history__dianhua"] = "点化",
    [":history__dianhua"] = "准备阶段或结束阶段，你可以观看牌堆顶4张牌，然后你可以获得其中与记录花色相同的一张牌，其余的牌以任意顺序放回牌堆顶。",
  
    ["#history__dianhua-choose"] = "点化：你可以获得其中与记录花色相同的一张牌，其余的牌以任意顺序放回牌堆顶。",

  }
local function getPatternsuit(suits)
    local ret=""
    local length=#suits
    for i,suit in ipairs(suits) do
        ret=ret..string.sub(suit, 5)
        if i<length then
            ret=ret..","
        end
    end
    return ret
end
  
skel:addEffect(fk.EventPhaseStart, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and (player.phase == Player.Start or player.phase == Player.Finish)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local cards = room:getNCards(4)
    local suits = player:getTableMark("@history__falu")
    local ret=getPatternsuit(suits)
    local pattern=".|.|"
    pattern=pattern..ret
    local result = room:askToArrangeCards(player, {
      skill_name = skel.name,
      card_map = {cards,  "Top", "$Hand"},
      prompt = "#history__dianhua-choose",
      free_arrange = true,
      box_size = 4,
      pattern=pattern,
      max_limit={4,1},
    })
    room:obtainCard(player, result[2], false, nil, player, skel.name)
  end,
})
  
  return skel
  